1200.21
1
22
int main()
{
database employee; employee.age=22; employee.id_number=1; employee.salary=1200.21;
return 0;
}
Structures
Example 1: Declaration
struct database {
int id_number;
int age;
float salary;
};
COMMENT TO EXAMPLE.
database employee; //There is now an employee variable that has modifiable variables inside it.
The struct database declares that database has three variables in it, age, id_number, and salary.

You can use database like a variable type like int. You can create an employee with the database type as I did above. Then, to modify it you call everything with the 'employee.' in front of it. You can also return structures from functions by defining their return type as a structure type. Example:

struct database fn();